package com.leiusual.mall_ad

import android.content.Context
import android.util.Log
import androidx.startup.Initializer
import com.fighter.loader.AppCategory
import com.fighter.loader.ReaperApi
import com.fighter.loader.ReaperInit

/**
 * author: leiusual
 * create on: 2020/10/28
 * description:
 */
class MallAdInitializer : Initializer<ReaperApi> {

  companion object {
    private val TAG = MallAdInitializer::class.java.simpleName

    var reaperApi: ReaperApi? = null
  }

  override fun create(context: Context): ReaperApi {
    Log.d(TAG, "create")
    val reaperApi = ReaperInit.init(context)
    reaperApi.init(context, "100015", "3353bea731f341775a015ef3515864c2")
    reaperApi.setAppCategory(AppCategory.CATEGORY_OTHER_APP)
    MallAdInitializer.reaperApi = reaperApi
    return reaperApi
  }

  override fun dependencies(): MutableList<Class<out Initializer<*>>> {
    Log.d(TAG, "dependencies")
    return mutableListOf()
  }
}